<?php
require_once('classes/AddressDAL.php');
require_once('classes/BlogDAL.php');
require_once('classes/CountryDAL.php');
require_once('classes/DistrictDAL.php');
require_once('classes/LocationDAL.php');
require_once('classes/PracticeDAL.php');
require_once('classes/ProblemDAL.php');
require_once('classes/ProfessionDAL.php');
require_once('classes/SalutationDAL.php');
require_once('classes/SpecializationDAL.php');
require_once('classes/TargetDAL.php');
require_once('classes/UserDAL.php');
require_once('classes/SiteStatisticsDAL.php');

class PinkPonyController{

	//User
	public static function getUsers(){
		return UserDAL::Instance()->getUsers();
	}
	
	public static function getUserById($userId){
		return UserDAL::Instance()->getUserById($userId);
	}
	
	public static function loginUser($us){
		return UserDAL::Instance()->loginUser($us);
	}
	
	public static function addUser($us)
	{
		return UserDAL::Instance()->addUser($us);
	}
	
	public static function updateUser($us)
	{
		UserDAL::Instance()->updateUser($us);
	}
	
	public static function removeUser($userId)
	{
		UserDAL::Instance()->removeUser($userId);
	}
	
	public static function getUserByUsername($username)
	{
		UserDAL::Instance()->getUserByUsername($username);
	}
	
	
	//Address
	public static function getAddresses(){
		return AddressDAL::Instance()->getAddresses();
	}
	
	public static function getAddressById($id){
		return AddressDAL::Instance()->getAddressById($id);
	}
	
	public static function addAddress($address)
	{
		return AddressDAL::Instance()->addAddress($address);
	}
	
	public static function updateAddress($address)
	{
		AddressDAL::Instance()->updateAddress($address);
	}
	
	public static function removeAddress($id)
	{
		AddressDAL::Instance()->removeAddress($id);
	}
	
	
	//Blog
	public static function getBlogs()
	{
		return BlogDAL::Instance()->getBlogs();
	}
	
	public static function getBlogsForUser($userId)
	{
		return BlogDAL::Instance()->getBlogsForUser($userId);
	}
	
	public static function getBlogsForPractice($practiceId)
	{
		return BlogDAL::Instance()->getBlogsForPractice($practiceId);
	}
	
	public static function addBlog($blog)
	{
		BlogDAL::Instance()->addBlog($blog);
	}
	
	public static function removeBlog($blogId)
	{
		BlogDAL::Instance()->removeBlog($blogId);
	}
	
	public static function updateBlog($blog)
	{
		BlogDAL::Instance()->updateBlog($blog);
	}
	
	public static function getBlogsById($blogId)
	{
		return BlogDAL::Instance()->getBlogsById($blogId);
	}
	
	//Location
	public static function getLocations(){
		return LocationDAL::Instance()->getLocations();
	}
	
	public static function getLocationsWithPracticesByDistrict($id){
		return LocationDAL::Instance()->getLocationsWithPracticesByDistrict($id);
	}
	
	public static function getLocationsByDistrict($id){
		return LocationDAL::Instance()->getLocationsByDistrict($id);
	}
	
	public static function getLocationsByCountry($id){
		return LocationDAL::Instance()->getLocationsByCountry($id);
	}
	
	public static function addLocation($location)
	{
		LocationDAL::Instance()->addLocation($location);
	}
	
	/*
	public static function updateLocation($location)
	{
		LocationDAL::Instance()->updateLocation($location);
	}
	
	public static function removeLocation($id)
	{
		LocationDAL::Instance()->removeLocation($id);
	}
	*/
	
	
	
	
	//District
	public static function getDistricts(){
		return DistrictDAL::Instance()->getDistricts();
	}
	
	public static function getDistrictsByCountry($id){
		return DistrictDAL::Instance()->getDistrictsByCountry($id);
	}
	
	public static function addDistrict($district)
	{
		DistrictDAL::Instance()->addDistrict($district);
	}
	
	public static function updateDistrict($district)
	{
		DistrictDAL::Instance()->updateDistrict($district);
	}
	
	public static function removeDistrict($id)
	{
		DistrictDAL::Instance()->removeDistrict($id);
	}
	
	
	
	//Country
	public static function getCountries(){
		return CountryDAL::Instance()->getCountries();
	}
	
	public static function getCountryById($id){
		return CountryDAL::Instance()->getCountryById($id);
	}
	
	public static function addCountry($country)
	{
		CountryDAL::Instance()->addCountry($country);
	}
	
	public static function updateCountry($country)
	{
		CountryDAL::Instance()->updateCountry($country);
	}
	
	public static function removeCountry($id)
	{
		CountryDAL::Instance()->removeCountry($id);
	}
	
	
	
	
	//Practice
	public static function getPractices(){
		return PracticeDAL::Instance()->getPractices();
	}
	
	public static function getPracticeById($id){
		return PracticeDAL::Instance()->getPracticeById($id);
	}
	
	public static function getPracticesByPostalNumberOrLocationName($searchString, $countryId){
		return PracticeDAL::Instance()->getPracticesByPostalNumberOrLocationName($searchString, $countryId);
	}
	
	
	public static function getPracticesByAdvancedSearch($name, $countryId, $districtId, $professionId, $specializationId, $targetId, $problemId, $sex){
		/*$myFile = "textfile.txt";
		$fh = fopen($myFile, 'w');
		$string = "countryId: " . $countryId . "\n";
		fwrite($fh, $string);*/
		
		return PracticeDAL::Instance()->getPracticesByAdvancedSearch($name, $countryId, $districtId, $professionId, $specializationId, $targetId, $problemId, $sex);
	}
	
	public static function addPractice($practice)
	{
		return PracticeDAL::Instance()->addPractice($practice);
	}
	
	public static function updatePractice($practice)
	{
		PracticeDAL::Instance()->updatePractice($practice);
	}
	
	public static function removePractice($id)
	{
		PracticeDAL::Instance()->removePractice($id);
	}
	
	public function getPracticesForUser($id){
		return PracticeDAL::Instance()->getPracticesForUser($id);
	}
	
	public function getCountryForPractice($practiceId)
	{
		return PracticeDAL::Instance()->getCountryForPractice($practiceId);
	}
	
	
	
	
	
	
	//Problem
	public static function getProblems(){
		return ProblemDAL::Instance()->getProblems();
	}
	
	public static function getProblemById($id){
		return ProblemDAL::Instance()->getProblemById($id);
	}
	
	public static function getProblemsForUser($userId){
		return ProblemDAL::Instance()->getProblemsForUser($userId);
	}
	
	public static function addProblem($problem)
	{
		ProblemDAL::Instance()->addProblem($problem);
	}
	
	public static function updateProblem($problem)
	{
		ProblemDAL::Instance()->updateProblem($problem);
	}
	
	public static function removeProblem($id)
	{
		ProblemDAL::Instance()->removeProblem($id);
	}
	
	
	//Profession
	public static function getProfessions(){
		return ProfessionDAL::Instance()->getProfessions();
	}
	
	public static function getProfessionById($id){
		return ProfessionDAL::Instance()->getProfessionById($id);
	}
	
	public static function addProfession($profession)
	{
		ProfessionDAL::Instance()->addProfession($profession);
	}
	
	public static function updateProfession($profession)
	{
		ProfessionDAL::Instance()->updateProfession($profession);
	}
	
	public static function removeProfession($id)
	{
		ProfessionDAL::Instance()->removeProfession($id);
	}
	
	
	
	
	//Salutation
	public static function getSalutations(){
		return SalutationDAL::Instance()->getSalutations();
	}
	
	public static function getSalutationById($id){
		return SalutationDAL::Instance()->getSalutationById($id);
	}
	
	public static function addSalutation($salutation)
	{
		SalutationDAL::Instance()->addSalutation($salutation);
	}
	
	/*public static function updateProfession($profession)
	{
		ProfessionDAL::Instance()->updateProfession($profession);
	}
	
	public static function removeProfession($id)
	{
		ProfessionDAL::Instance()->removeProfession($id);
	}
	*/
	
	
	
	//Specialization
	public static function getSpecializations(){
		return SpecializationDAL::Instance()->getSpecializations();
	}
	
	public static function getSpecializationById($id){
		return SpecializationDAL::Instance()->getSpecializationById($id);
	}
	
	public static function getSpecializationsForUser($userId){
		return SpecializationDAL::Instance()->getSpecializationsForUser($userId);
	}
	
	public static function addSpecialization($specialization)
	{
		SpecializationDAL::Instance()->addSpecialization($specialization);
	}
	
	public static function updateSpecialization($specialization)
	{
		SpecializationDAL::Instance()->updateSpecialization($specialization);
	}
	
	public static function removeSpecialization($id)
	{
		SpecializationDAL::Instance()->removeSpecialization($id);
	}
	
	
	
	
	
	//Target
	public static function getTargets(){
		return TargetDAL::Instance()->getTargets();
	}
	
	public static function getTargetById($id){
		return TargetDAL::Instance()->getTargetById($id);
	}
	
	public static function getTargetsForUser($userId){
		return TargetDAL::Instance()->getTargetsForUser($userId);
	}
	
	public static function addTarget($target)
	{
		TargetDAL::Instance()->addTarget($target);
	}
	
	/*
	public static function updateTarget($target)
	{
		TargetDAL::Instance()->updateTarget($target);
	}
	*/
	
	public static function removeTarget($id)
	{
		TargetDAL::Instance()->removeTarget($id);
	}
	
	
	//Site Statistics
	public static function getSiteStatistics()
	{
		return SiteStatisticsDAL::Instance()->getSiteStatistics();
	}
	
}
?>